﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class SecurityEval : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void DropDownList_dpt_DataBound(object sender, EventArgs e)
    {
        //After data bound, we can add a new item in the dropdown list
        ListItem AllDpt = new ListItem("所有部门", "0");
        DropDownList_dpt.Items.Insert(0, AllDpt);
    }
    
    protected string GetDptNameById(object DptId)
    {
        DepartmentDb dptDb = new DepartmentDb();

        return (string)dptDb.GetDepartmentNameById((int)DptId);
    }

    protected void DropDownList_dpt_SelectedIndexChanged(object sender, EventArgs e)
    {
        DropDownList dpt = (DropDownList)sender;
        ObjectDataSource_staff.SelectParameters["DepartmentNum"].DefaultValue = dpt.SelectedValue; 
        
    }
    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        Utility.FormatGridview(GridView1, e);  
    }
}
